package top.lww0511.extra.annotation;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 一对多
 *
 * @author lww
 */
@Inherited
@Documented
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface One2Many {

    /**
     * 本类主键列名
     */
    String self() default "id";

    /**
     * 本类主键在关联表中的列名
     */
    String as() default "";

    /**
     * 关联的 mapper
     */
    Class<? extends BaseMapper> mapper() default BaseMapper.class;

}
